#include "lvgl.h"

/*******************************************************************************
 * Tool: MCU_Font V2.0
 * Time: 2020-11-12 23:48:48
 * Bpp: 4
 * LineHeight: 8 px
 * BaseLine: 1
 * 
 * FontCount: 1
 * FontSize_1: 5px  FontFamily_1: 黑体  
 ******************************************************************************/

#ifndef DATE_TIME_FONT_5
#define DATE_TIME_FONT_5 1
#endif

#if DATE_TIME_FONT_5

/*-----------------
 *    BITMAPS
 *----------------*/

/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {

    /* U+2d "-" */
    0x12, 0x20, 

    /* U+30 "0" */
    0x7, 0x70, 0x73, 0x55, 0x81, 0x16, 0x70, 0x16, 
    0x73, 0x37, 0x1b, 0xb1, 

    /* U+31 "1" */
    0x1c, 0x55, 0x55, 

    /* U+32 "2" */
    0x7, 0x70, 0x72, 0x57, 0x0, 0x55, 0x1, 0x80, 
    0x9, 0x10, 0x7d, 0xd6, 

    /* U+33 "3" */
    0x7, 0x70, 0x73, 0x37, 0x0, 0x73, 0x0, 0x85, 
    0x50, 0x37, 0x3c, 0xb1, 

    /* U+34 "4" */
    0x0, 0x52, 0x3, 0xe3, 0x8, 0x73, 0x73, 0x73, 
    0x7a, 0xc9, 0x0, 0x73, 

    /* U+35 "5" */
    0x55, 0x0, 0x7d, 0x90, 0x0, 0x37, 0x50, 0x37, 
    0x5d, 0xc1, 

    /* U+36 "6" */
    0x0, 0x60, 0x7, 0x30, 0x3d, 0x90, 0x83, 0x18, 
    0x81, 0x19, 0x3b, 0xb3, 

    /* U+37 "7" */
    0x0, 0x37, 0x0, 0x70, 0x3, 0x70, 0x7, 0x30, 
    0x7, 0x0, 

    /* U+38 "8" */
    0x7, 0x70, 0x81, 0x35, 0x77, 0x83, 0x77, 0x85, 
    0x80, 0x18, 0x5d, 0xc3, 

    /* U+39 "9" */
    0x7, 0x70, 0x82, 0x67, 0x80, 0x37, 0x4d, 0xd1, 
    0x3, 0x70, 0x9, 0x10, 

    /* U+3a ":" */
    0x50, 0x4, 

    /* U+5f "_" */
    0x45, 0x54, 
};

/*---------------------
 *  GLYPH DESCRIPTION
 *--------------------*/

static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
/* id = 0 reserved */  {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0},
/* U+2d "-" */  {.bitmap_index = 0, .adv_w = 56, .box_w = 4, .box_h = 1, .ofs_x = 0, .ofs_y = 3},
/* U+30 "0" */  {.bitmap_index = 2, .adv_w = 56, .box_w = 4, .box_h = 6, .ofs_x = 0, .ofs_y = 0},
/* U+31 "1" */  {.bitmap_index = 14, .adv_w = 56, .box_w = 1, .box_h = 6, .ofs_x = 1, .ofs_y = 0},
/* U+32 "2" */  {.bitmap_index = 17, .adv_w = 56, .box_w = 4, .box_h = 6, .ofs_x = 0, .ofs_y = 0},
/* U+33 "3" */  {.bitmap_index = 29, .adv_w = 56, .box_w = 4, .box_h = 6, .ofs_x = 0, .ofs_y = 0},
/* U+34 "4" */  {.bitmap_index = 41, .adv_w = 56, .box_w = 4, .box_h = 6, .ofs_x = 0, .ofs_y = 0},
/* U+35 "5" */  {.bitmap_index = 53, .adv_w = 56, .box_w = 4, .box_h = 5, .ofs_x = 0, .ofs_y = 0},
/* U+36 "6" */  {.bitmap_index = 63, .adv_w = 56, .box_w = 4, .box_h = 6, .ofs_x = 0, .ofs_y = 0},
/* U+37 "7" */  {.bitmap_index = 75, .adv_w = 56, .box_w = 4, .box_h = 5, .ofs_x = 0, .ofs_y = 0},
/* U+38 "8" */  {.bitmap_index = 85, .adv_w = 56, .box_w = 4, .box_h = 6, .ofs_x = 0, .ofs_y = 0},
/* U+39 "9" */  {.bitmap_index = 97, .adv_w = 56, .box_w = 4, .box_h = 6, .ofs_x = 0, .ofs_y = 0},
/* U+3a ":" */  {.bitmap_index = 109, .adv_w = 56, .box_w = 1, .box_h = 4, .ofs_x = 2, .ofs_y = 0},
/* U+5f "_" */  {.bitmap_index = 111, .adv_w = 56, .box_w = 4, .box_h = 1, .ofs_x = 0, .ofs_y = -1},
};

/*---------------------
 *  CHARACTER MAPPING
 *--------------------*/

static const uint16_t unicode_list_1[] = {

    0x2d, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 
    0x37, 0x38, 0x39, 0x3a, 0x5f, 
};

/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
    {
        .range_start = 0, .range_length = 95, .glyph_id_start = 1,
        .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 13, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
    }
};

/*--------------------
 *  ALL CUSTOM DATA
 *--------------------*/
/*Store all the custom data of the font*/
static lv_font_fmt_txt_dsc_t font_dsc = {
    .glyph_bitmap = gylph_bitmap,
    .glyph_dsc = glyph_dsc,
    .cmaps = cmaps,
    .kern_dsc = NULL,
    .kern_scale = 0,
    .cmap_num = 1,
    .bpp = 4,
    .kern_classes = 0,
    .bitmap_format = 0
};

/*-----------------
 *  PUBLIC FONT
 *----------------*/

/*Initialize a public general font descriptor*/
lv_font_t date_time_font_5 = {
    .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt,    /*Function pointer to get glyph's data*/
    .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt,    /*Function pointer to get glyph's bitmap*/
    .line_height = 8,          /*The maximum line height required by the font*/
    .base_line = 1,             /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
    .subpx = LV_FONT_SUBPX_NONE,
#endif
    .dsc = &font_dsc           /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if DATE_TIME_FONT_5*/
